﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DateTime_日期时间_
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //DateTime time = DateTime.Now;
            //Console.WriteLine(time);//运行到当前位置的系统时间

            DateTime dateTime = new DateTime(2024, 12, 23, 15, 07, 20);
            Console.WriteLine(dateTime.ToString());//2024/12/23 15:07:20
            Console.WriteLine(dateTime.ToLongDateString());//2024年12月23日
            Console.WriteLine(dateTime.ToLongTimeString());//15:07:20
            Console.WriteLine(dateTime.ToShortDateString());//2024/12/23
            Console.WriteLine(dateTime.ToShortTimeString());//15:07
        }
    }
}
